﻿#ifndef MEDIADEVICE_H
#define MEDIADEVICE_H

#include <QObject>

#include "common/AudioParam.h"

class MediaDevice : public QObject
{
    Q_OBJECT
public:
    enum MediaDeviceType {
        MediaDeviceType_Input,
        MediaDeviceType_Output
    };
public:
    MediaDevice(QObject *parent = nullptr);
    virtual ~MediaDevice();
    virtual AudioParam getParam();

    virtual void setDeviceId(const QString &deviceId);
    virtual QString getDeviceId();

    virtual bool isPrepare() = 0;

protected:
    virtual bool init() = 0;
    virtual bool capture() = 0;

public slots:
    virtual void run() = 0;

    // member data
protected:
    QString m_deviceId;
    AudioParam m_param;
};

#endif // MEDIADEVICE_H
